﻿<!doctype html>
<html>
<head>
    <meta charset="UTF-8">  
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>运输管理系统</title>  
    <link rel="stylesheet" type="text/css" href="../js/jquery-easyui-1.4.4/themes/metro/easyui.css">  
    <link rel="stylesheet" type="text/css" href="../js/jquery-easyui-1.4.4/themes/mobile.css">  
    <link rel="stylesheet" type="text/css" href="../js/jquery-easyui-1.4.4/themes/icon.css">  
    <script type="text/javascript" src="../js/jquery-easyui-1.4.4/jquery.min.js"></script>  
    <script type="text/javascript" src="../js/jquery-easyui-1.4.4/jquery.easyui.min.js"></script> 
    <script type="text/javascript" src="../js/jquery-easyui-1.4.4/jquery.easyui.mobile.js"></script> 
    <script src="../../Scripts/jsbase.js" type="text/javascript"></script>
    <script src="../../Scripts/webcontrols/datasource.js" type="text/javascript"></script>
    <script src="scripts/newjs/page.js" type="text/javascript"></script>
    <script src="scripts/newjs/from.js" type="text/javascript"></script>
    <script src="scripts/newjs/grid.js" type="text/javascript"></script>
    <script src="scripts/newjs/textbox.js" type="text/javascript"></script>

     <script type="text/javascript">
         var code, state;
         $(document).ready(function () {
             code = getArgsFromUrl("code");
             state = getArgsFromUrl("state");
             if (code != "" && state != "") {
                 $("header").hide();
                 $("title").html("登录认证");
             }
             else {
                 $("header").show();
                 $("title").html("登录系统");
             }
             $("#login .easyui-linkbutton").bind("click", function () {
                 var name = $("#user").val();
                 var pass = $("#pass").val();
                 webjs.login(name, pass, function (obj) {
                     if (code != "" && state != "") {
                         var d = new datasource();
                         d.c = "Way.Wx.Controllers.AccessToken";
                         var e = d.post("Login", "code=" + code + "&state=" + state);
                         if (e && e.error) {
                             $.messager.alert('异常', e.errormsg, 'error');
                         }
                         else
                             $.messager.show({ title: '消息', msg: '认证完成。', showType: 'show' });
                     }
                     $.mobile.go("#main");
                     return;
                 });
             });
             var err = getArgsFromUrl("errormsg");
             if (err != "") {
                 $.messager.alert('异常', err, 'error');
             }
         });
         function mainclick(c) {
             var p = new page();
             p.c = c;
             p.init();
         }
         function getArgsFromUrl (sArgName) {
             var sHref = window.location.href;
             var args = sHref.split("?");
             var retval = "";
             if (args[0] == sHref) /*参数为空*/
             {
                 return retval; /*无需做任何处理*/
             }
             var str = args[1];
             args = str.split("&");
             for (var i = 0; i < args.length; i++) {
                 str = args[i];
                 var arg = str.split("=");
                 if (arg.length <= 1) continue;
                 if (arg[0] == sArgName)
                     retval = arg[1];
             }
             return retval;
         }
    </script>
</head>
<body>
    <div class="easyui-navpanel" id="login">
        <header>
            <div class="m-toolbar">
                <span class="m-title">登录系统</span>
            </div>
        </header>
        <div style="margin:20px auto;width:100px;height:100px;border-radius:100px;overflow:hidden">
            <img src="" style="margin:0;width:100%;height:100%;">
        </div>
        <div style="padding:0 20px">
            <div style="margin-bottom:10px">
                <input class="easyui-textbox" id="user" data-options="prompt:'用户名',iconCls:'icon-man'" style="width:100%;height:38px">
            </div>
            <div>
                <input class="easyui-textbox" id="pass" type="password" data-options="prompt:'密码',iconCls:'icon-lock'" style="width:100%;height:38px">
            </div>
            <div style="text-align:center;margin-top:30px">
                <a href="#" class="easyui-linkbutton" style="width:100%;height:40px"><span style="font-size:16px">登录</span></a>
            </div>
        </div>
    </div>
    <div class="easyui-navpanel" id="main">
        <header>
            <div class="m-toolbar">
                <div class="m-title">主页</div>
                <div class="m-left">
                    <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-man',plain:true"></a>
                </div>
                <div class="m-right">
                    <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true"></a>
                </div>
            </div>
        </header>
         <footer>
            <div class="m-buttongroup m-buttongroup-justified" style="width:100%">
                <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-large-picture',size:'large',iconAlign:'top',plain:true">主页</a>
                <a href="javascript:void(0)" onclick="mainclick('Way.Bus.WMS.ST.Controllers.YS.ST_PackListController');" class="easyui-linkbutton" data-options="iconCls:'icon-large-clipart',size:'large',iconAlign:'top',plain:true">装车</a>
                <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-large-shapes',size:'large',iconAlign:'top',plain:true">运输</a>
                <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-large-smartart',size:'large',iconAlign:'top',plain:true">签收</a>
            </div>
        </footer>
    </div>
    <div id="page" class="easyui-navpanel">
        <header>
            <div class="m-toolbar">
                <span id="page-title" class="m-title"></span>
                <div class="m-left">
                    <a href="javascript:void(0)" class="easyui-linkbutton m-back" plain="true" outline="true" style="width:50px" onclick="$.mobile.back()">返回</a>
                </div>
                <div class="m-right">
                    <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true"></a>
                </div>
            </div>
        </header>
         <footer></footer>
        <ul id="page-datalist" class="easyui-datalist"></ul>
    </div>
     <div id="from" class="easyui-navpanel">
        <header>
            <div class="m-toolbar">
                <span id="from-title" class="m-title"></span>
                <div class="m-left">
                    <a href="javascript:void(0)" class="easyui-linkbutton m-back" plain="true" outline="true" style="width:50px" onclick="$.mobile.back()">返回</a>
                </div>
                <div class="m-right">
                    <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true"></a>
                </div>
            </div>
        </header>
         <footer></footer>
    </div>
</body>    
</html>